﻿<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
  
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Class Option
   | CodeJam </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Class Option
   | CodeJam ">
    <meta name="generator" content="docfx 2.23.1.0">
    
    <link rel="shortcut icon" href="../../favicon.ico">
    <link rel="stylesheet" href="../../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../../styles/docfx.css">
    <link rel="stylesheet" href="../../styles/main.css">
    <meta property="docfx:navrel" content="../../toc.html">
    <meta property="docfx:tocrel" content="toc.html">
    <meta property="docfx:rel" content="../../">
    
  </head>
  <body data-spy="scroll" data-target="#affix">
    <div id="wrapper">
      <header>
        
        <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
          <div class="container">
            <div class="navbar-header">
              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              
              <a class="navbar-brand" href="../../index.html">
                <img id="logo" class="svg" src="../../images/CodeJam.Main.Icon.png" alt="">
              </a>
            </div>
            <div class="collapse navbar-collapse" id="navbar">
              <form class="navbar-form navbar-right" role="search" id="search">
                <div class="form-group">
                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
                </div>
              </form>
            </div>
          </div>
        </nav>
        
        <div class="subnav navbar navbar-default">
          <div class="container hide-when-search" id="breadcrumb">
            <ul class="breadcrumb">
              <li></li>
            </ul>
          </div>
        </div>
      </header>
      <div class="container body-content">
        
        <div id="search-results">
          <div class="search-list"></div>
          <div class="sr-items"></div>
          <ul id="pagination"></ul>
        </div>
      </div>
      <div role="main" class="container body-content hide-when-search">
        
        <div class="sidenav hide-when-search">
          <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
          <div class="sidetoggle collapse" id="sidetoggle">
            <div id="sidetoc"></div>
          </div>
        </div>
        <div class="article row grid-right">
          <div class="col-md-10">
            <article class="content wrap" id="_content" data-uid="CodeJam.Option">
  
  
  <h1 id="CodeJam_Option" data-uid="CodeJam.Option" class="text-break">Class Option
  </h1>
  <div class="markdown level0 summary"><p>Methods to work with <a class="xref" href="CodeJam.Option.html">Option</a></p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><span class="xref">System.Object</span></div>
    <div class="level1"><span class="xref">Option</span></div>
  </div>
  <div class="inheritedMembers">
    <h5>Inherited Members</h5>
    <div>
      <span class="xref">System.Object.ToString()</span>
    </div>
    <div>
      <span class="xref">System.Object.Equals(System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.GetHashCode()</span>
    </div>
    <div>
      <span class="xref">System.Object.GetType()</span>
    </div>
    <div>
      <span class="xref">System.Object.MemberwiseClone()</span>
    </div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="CodeJam.html">CodeJam</a></h6>
  <h6><strong>Assembly</strong>: CodeJam.dll</h6>
  <h5 id="CodeJam_Option_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static class Option</code></pre>
  </div>
  <h3 id="methods">Methods
  </h3>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/rsdn/CodeJam/new/master/apiSpec/new?filename=CodeJam_Option_Do__1_CodeJam_IOption___0__System_Action_CodeJam_IOption___0___System_Action_.md&amp;value=---%0Auid%3A%20CodeJam.Option.Do%60%601(CodeJam.IOption%7B%60%600%7D%2CSystem.Action%7BCodeJam.IOption%7B%60%600%7D%7D%2CSystem.Action)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/rsdn/CodeJam/blob/master/Main/src/Structures/Option/Option.cs/#L67">View Source</a>
  </span>
  <a id="CodeJam_Option_Do_" data-uid="CodeJam.Option.Do*"></a>
  <h4 id="CodeJam_Option_Do__1_CodeJam_IOption___0__System_Action_CodeJam_IOption___0___System_Action_" data-uid="CodeJam.Option.Do``1(CodeJam.IOption{``0},System.Action{CodeJam.IOption{``0}},System.Action)">Do&lt;T&gt;(IOption&lt;T&gt;, Action&lt;IOption&lt;T&gt;&gt;, Action)</h4>
  <div class="markdown level1 summary"><p>Calls <code data-dev-comment-type="paramref" class="paramref">someAction</code> if <code data-dev-comment-type="paramref" class="paramref">option</code> has value,
and <code data-dev-comment-type="paramref" class="paramref">noneAction</code> otherwise.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static void Do&lt;T&gt;(this IOption&lt;T&gt; option, Action&lt;IOption&lt;T&gt;&gt; someAction, Action noneAction)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><a class="xref" href="CodeJam.IOption-1.html">IOption</a>&lt;T&gt;</td>
        <td><span class="parametername">option</span></td>
        <td><p><a class="xref" href="CodeJam.Option.html">Option</a> instance to match.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Action</span>&lt;<a class="xref" href="CodeJam.IOption-1.html">IOption</a>&lt;T&gt;&gt;</td>
        <td><span class="parametername">someAction</span></td>
        <td><p>Action if value exists.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Action</span></td>
        <td><span class="parametername">noneAction</span></td>
        <td><p>Action if no value.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="typeParameters">Type Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="parametername">T</span></td>
        <td><p>Type of value</p>
</td>
      </tr>
    </tbody>
  </table>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/rsdn/CodeJam/new/master/apiSpec/new?filename=CodeJam_Option_GetValueOrDefault__1_CodeJam_IOption___0____0_.md&amp;value=---%0Auid%3A%20CodeJam.Option.GetValueOrDefault%60%601(CodeJam.IOption%7B%60%600%7D%2C%60%600)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/rsdn/CodeJam/blob/master/Main/src/Structures/Option/Option.cs/#L113">View Source</a>
  </span>
  <a id="CodeJam_Option_GetValueOrDefault_" data-uid="CodeJam.Option.GetValueOrDefault*"></a>
  <h4 id="CodeJam_Option_GetValueOrDefault__1_CodeJam_IOption___0____0_" data-uid="CodeJam.Option.GetValueOrDefault``1(CodeJam.IOption{``0},``0)">GetValueOrDefault&lt;T&gt;(IOption&lt;T&gt;, T)</h4>
  <div class="markdown level1 summary"><p>Returns value of <code data-dev-comment-type="paramref" class="paramref">option</code>, or <code data-dev-comment-type="paramref" class="paramref">defaultValue</code> if <code data-dev-comment-type="paramref" class="paramref">option</code>
hasn&apos;t it.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static T GetValueOrDefault&lt;T&gt;(this IOption&lt;T&gt; option, T defaultValue = null)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><a class="xref" href="CodeJam.IOption-1.html">IOption</a>&lt;T&gt;</td>
        <td><span class="parametername">option</span></td>
        <td><p><a class="xref" href="CodeJam.Option.html">Option</a> instance.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">T</span></td>
        <td><span class="parametername">defaultValue</span></td>
        <td><p>Default value.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">T</span></td>
        <td><p>Value, or <code data-dev-comment-type="paramref" class="paramref">defaultValue</code> if <code data-dev-comment-type="paramref" class="paramref">option</code> has no value.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="typeParameters">Type Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="parametername">T</span></td>
        <td><p>Type of value</p>
</td>
      </tr>
    </tbody>
  </table>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/rsdn/CodeJam/new/master/apiSpec/new?filename=CodeJam_Option_GetValueOrDefault__2_CodeJam_IOption___0__System_Func_CodeJam_IOption___0____1__System_Func___1__.md&amp;value=---%0Auid%3A%20CodeJam.Option.GetValueOrDefault%60%602(CodeJam.IOption%7B%60%600%7D%2CSystem.Func%7BCodeJam.IOption%7B%60%600%7D%2C%60%601%7D%2CSystem.Func%7B%60%601%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/rsdn/CodeJam/blob/master/Main/src/Structures/Option/Option.cs/#L92">View Source</a>
  </span>
  <a id="CodeJam_Option_GetValueOrDefault_" data-uid="CodeJam.Option.GetValueOrDefault*"></a>
  <h4 id="CodeJam_Option_GetValueOrDefault__2_CodeJam_IOption___0__System_Func_CodeJam_IOption___0____1__System_Func___1__" data-uid="CodeJam.Option.GetValueOrDefault``2(CodeJam.IOption{``0},System.Func{CodeJam.IOption{``0},``1},System.Func{``1})">GetValueOrDefault&lt;T, TResult&gt;(IOption&lt;T&gt;, Func&lt;IOption&lt;T&gt;, TResult&gt;, Func&lt;TResult&gt;)</h4>
  <div class="markdown level1 summary"><p>Calls <code data-dev-comment-type="paramref" class="paramref">someSelector</code> if <code data-dev-comment-type="paramref" class="paramref">option</code> has value,
and <code data-dev-comment-type="paramref" class="paramref">noneSelector</code> otherwise.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static TResult GetValueOrDefault&lt;T, TResult&gt;(this IOption&lt;T&gt; option, Func&lt;IOption&lt;T&gt;, TResult&gt; someSelector, Func&lt;TResult&gt; noneSelector)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><a class="xref" href="CodeJam.IOption-1.html">IOption</a>&lt;T&gt;</td>
        <td><span class="parametername">option</span></td>
        <td><p><a class="xref" href="CodeJam.Option.html">Option</a> instance to match.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Func</span>&lt;<a class="xref" href="CodeJam.IOption-1.html">IOption</a>&lt;T&gt;, TResult&gt;</td>
        <td><span class="parametername">someSelector</span></td>
        <td><p>Function if value exists.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Func</span>&lt;TResult&gt;</td>
        <td><span class="parametername">noneSelector</span></td>
        <td><p>Function if no value.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">TResult</span></td>
        <td><p>Result of matched function</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="typeParameters">Type Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="parametername">T</span></td>
        <td><p>Type of value</p>
</td>
      </tr>
      <tr>
        <td><span class="parametername">TResult</span></td>
        <td><p>Type of result</p>
</td>
      </tr>
    </tbody>
  </table>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/rsdn/CodeJam/new/master/apiSpec/new?filename=CodeJam_Option_None__1.md&amp;value=---%0Auid%3A%20CodeJam.Option.None%60%601%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/rsdn/CodeJam/blob/master/Main/src/Structures/Option/Option.cs/#L56">View Source</a>
  </span>
  <a id="CodeJam_Option_None_" data-uid="CodeJam.Option.None*"></a>
  <h4 id="CodeJam_Option_None__1" data-uid="CodeJam.Option.None``1">None&lt;T&gt;()</h4>
  <div class="markdown level1 summary"><p>Returns instance of <a class="xref" href="CodeJam.Option.html">Option</a> without value.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Option&lt;T&gt; None&lt;T&gt;()</code></pre>
  </div>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><a class="xref" href="CodeJam.Option-1.html">Option</a>&lt;T&gt;</td>
        <td><p>Instance without value.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="typeParameters">Type Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="parametername">T</span></td>
        <td><p>Type of value.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 id="CodeJam_Option_None__1_remarks">Remarks</h5>
  <div class="markdown level1 remarks"><p>None value is singleton.</p>
</div>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/rsdn/CodeJam/new/master/apiSpec/new?filename=CodeJam_Option_Some__1___0_.md&amp;value=---%0Auid%3A%20CodeJam.Option.Some%60%601(%60%600)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/rsdn/CodeJam/blob/master/Main/src/Structures/Option/Option.cs/#L21">View Source</a>
  </span>
  <a id="CodeJam_Option_Some_" data-uid="CodeJam.Option.Some*"></a>
  <h4 id="CodeJam_Option_Some__1___0_" data-uid="CodeJam.Option.Some``1(``0)">Some&lt;T&gt;(T)</h4>
  <div class="markdown level1 summary"><p>Creates instance of <a class="xref" href="CodeJam.Option.html">Option</a> with specified value.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Option&lt;T&gt; Some&lt;T&gt;(T value)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">T</span></td>
        <td><span class="parametername">value</span></td>
        <td><p>Value</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><a class="xref" href="CodeJam.Option-1.html">Option</a>&lt;T&gt;</td>
        <td><p>Instance of <a class="xref" href="CodeJam.Option.html">Option</a>.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="typeParameters">Type Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="parametername">T</span></td>
        <td><p>Type of value</p>
</td>
      </tr>
    </tbody>
  </table>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/rsdn/CodeJam/new/master/apiSpec/new?filename=CodeJam_Option_SomeHasValue__1___0_.md&amp;value=---%0Auid%3A%20CodeJam.Option.SomeHasValue%60%601(%60%600)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/rsdn/CodeJam/blob/master/Main/src/Structures/Option/Option.cs/#L33">View Source</a>
  </span>
  <a id="CodeJam_Option_SomeHasValue_" data-uid="CodeJam.Option.SomeHasValue*"></a>
  <h4 id="CodeJam_Option_SomeHasValue__1___0_" data-uid="CodeJam.Option.SomeHasValue``1(``0)">SomeHasValue&lt;T&gt;(T)</h4>
  <div class="markdown level1 summary"><p>Creates instance of <a class="xref" href="CodeJam.Option.html">Option</a> with specified value, if value not null.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Option&lt;T&gt; SomeHasValue&lt;T&gt;(T value)where T : class</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">T</span></td>
        <td><span class="parametername">value</span></td>
        <td><p>Value</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><a class="xref" href="CodeJam.Option-1.html">Option</a>&lt;T&gt;</td>
        <td><p>Instance of <a class="xref" href="CodeJam.Option.html">Option</a> with <code data-dev-comment-type="paramref" class="paramref">value</code>, if <code data-dev-comment-type="paramref" class="paramref">value</code> not null,
or instance without value.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="typeParameters">Type Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="parametername">T</span></td>
        <td><p>Type of value</p>
</td>
      </tr>
    </tbody>
  </table>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/rsdn/CodeJam/new/master/apiSpec/new?filename=CodeJam_Option_SomeHasValue__1_System_Nullable___0__.md&amp;value=---%0Auid%3A%20CodeJam.Option.SomeHasValue%60%601(System.Nullable%7B%60%600%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/rsdn/CodeJam/blob/master/Main/src/Structures/Option/Option.cs/#L46">View Source</a>
  </span>
  <a id="CodeJam_Option_SomeHasValue_" data-uid="CodeJam.Option.SomeHasValue*"></a>
  <h4 id="CodeJam_Option_SomeHasValue__1_System_Nullable___0__" data-uid="CodeJam.Option.SomeHasValue``1(System.Nullable{``0})">SomeHasValue&lt;T&gt;(Nullable&lt;T&gt;)</h4>
  <div class="markdown level1 summary"><p>Creates instance of <a class="xref" href="CodeJam.Option.html">Option</a> with specified value, if <code data-dev-comment-type="paramref" class="paramref">value</code> has value.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Option&lt;T&gt; SomeHasValue&lt;T&gt;(T? value)where T : struct</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Nullable</span>&lt;T&gt;</td>
        <td><span class="parametername">value</span></td>
        <td><p>Value</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><a class="xref" href="CodeJam.Option-1.html">Option</a>&lt;T&gt;</td>
        <td><p>Instance of <a class="xref" href="CodeJam.Option.html">Option</a> with <code data-dev-comment-type="paramref" class="paramref">value</code>, if <code data-dev-comment-type="paramref" class="paramref">value</code> has value,
or instance without value.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="typeParameters">Type Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="parametername">T</span></td>
        <td><p>Type of value</p>
</td>
      </tr>
    </tbody>
  </table>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/rsdn/CodeJam/new/master/apiSpec/new?filename=CodeJam_Option_With__2_CodeJam_Option___0__System_Func___0___1__.md&amp;value=---%0Auid%3A%20CodeJam.Option.With%60%602(CodeJam.Option%7B%60%600%7D%2CSystem.Func%7B%60%600%2C%60%601%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/rsdn/CodeJam/blob/master/Main/src/Structures/Option/Option.cs/#L128">View Source</a>
  </span>
  <a id="CodeJam_Option_With_" data-uid="CodeJam.Option.With*"></a>
  <h4 id="CodeJam_Option_With__2_CodeJam_Option___0__System_Func___0___1__" data-uid="CodeJam.Option.With``2(CodeJam.Option{``0},System.Func{``0,``1})">With&lt;T, TResult&gt;(Option&lt;T&gt;, Func&lt;T, TResult&gt;)</h4>
  <div class="markdown level1 summary"><p>Converts <code data-dev-comment-type="paramref" class="paramref">option</code> value to another option with <code data-dev-comment-type="paramref" class="paramref">selectFunc</code>.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Option&lt;TResult&gt; With&lt;T, TResult&gt;(this Option&lt;T&gt; option, Func&lt;T, TResult&gt; selectFunc)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><a class="xref" href="CodeJam.Option-1.html">Option</a>&lt;T&gt;</td>
        <td><span class="parametername">option</span></td>
        <td><p><a class="xref" href="CodeJam.Option.html">Option</a> instance to match.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Func</span>&lt;T, TResult&gt;</td>
        <td><span class="parametername">selectFunc</span></td>
        <td><p>Function to map value</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><a class="xref" href="CodeJam.Option-1.html">Option</a>&lt;TResult&gt;</td>
        <td><p>Converted by <code data-dev-comment-type="paramref" class="paramref">selectFunc</code> value, or option with no value, if <code data-dev-comment-type="paramref" class="paramref">option</code>
has no value.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="typeParameters">Type Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="parametername">T</span></td>
        <td><p>Type of value</p>
</td>
      </tr>
      <tr>
        <td><span class="parametername">TResult</span></td>
        <td><p>Type of result</p>
</td>
      </tr>
    </tbody>
  </table>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/rsdn/CodeJam/new/master/apiSpec/new?filename=CodeJam_Option_With__2_CodeJam_Option___0__System_Func___0___1____1_.md&amp;value=---%0Auid%3A%20CodeJam.Option.With%60%602(CodeJam.Option%7B%60%600%7D%2CSystem.Func%7B%60%600%2C%60%601%7D%2C%60%601)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/rsdn/CodeJam/blob/master/Main/src/Structures/Option/Option.cs/#L151">View Source</a>
  </span>
  <a id="CodeJam_Option_With_" data-uid="CodeJam.Option.With*"></a>
  <h4 id="CodeJam_Option_With__2_CodeJam_Option___0__System_Func___0___1____1_" data-uid="CodeJam.Option.With``2(CodeJam.Option{``0},System.Func{``0,``1},``1)">With&lt;T, TResult&gt;(Option&lt;T&gt;, Func&lt;T, TResult&gt;, TResult)</h4>
  <div class="markdown level1 summary"><p>Converts <code data-dev-comment-type="paramref" class="paramref">option</code> value to another option with <code data-dev-comment-type="paramref" class="paramref">selectFunc</code>.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Option&lt;TResult&gt; With&lt;T, TResult&gt;(this Option&lt;T&gt; option, Func&lt;T, TResult&gt; selectFunc, TResult defaultValue)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><a class="xref" href="CodeJam.Option-1.html">Option</a>&lt;T&gt;</td>
        <td><span class="parametername">option</span></td>
        <td><p><a class="xref" href="CodeJam.Option.html">Option</a> instance to match.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Func</span>&lt;T, TResult&gt;</td>
        <td><span class="parametername">selectFunc</span></td>
        <td><p>Function to map value</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">TResult</span></td>
        <td><span class="parametername">defaultValue</span></td>
        <td><p>Default value.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><a class="xref" href="CodeJam.Option-1.html">Option</a>&lt;TResult&gt;</td>
        <td><p>Converted by <code data-dev-comment-type="paramref" class="paramref">selectFunc</code> value, or option with <code data-dev-comment-type="paramref" class="paramref">defaultValue</code>, if
<code data-dev-comment-type="paramref" class="paramref">option</code> has no value.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="typeParameters">Type Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="parametername">T</span></td>
        <td><p>Type of value</p>
</td>
      </tr>
      <tr>
        <td><span class="parametername">TResult</span></td>
        <td><p>Type of result</p>
</td>
      </tr>
    </tbody>
  </table>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/rsdn/CodeJam/new/master/apiSpec/new?filename=CodeJam_Option_With__2_CodeJam_Option___0__System_Func___0___1__System_Func___1__.md&amp;value=---%0Auid%3A%20CodeJam.Option.With%60%602(CodeJam.Option%7B%60%600%7D%2CSystem.Func%7B%60%600%2C%60%601%7D%2CSystem.Func%7B%60%601%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/rsdn/CodeJam/blob/master/Main/src/Structures/Option/Option.cs/#L175">View Source</a>
  </span>
  <a id="CodeJam_Option_With_" data-uid="CodeJam.Option.With*"></a>
  <h4 id="CodeJam_Option_With__2_CodeJam_Option___0__System_Func___0___1__System_Func___1__" data-uid="CodeJam.Option.With``2(CodeJam.Option{``0},System.Func{``0,``1},System.Func{``1})">With&lt;T, TResult&gt;(Option&lt;T&gt;, Func&lt;T, TResult&gt;, Func&lt;TResult&gt;)</h4>
  <div class="markdown level1 summary"><p>Converts <code data-dev-comment-type="paramref" class="paramref">option</code> value to another option with <code data-dev-comment-type="paramref" class="paramref">selectFunc</code>.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static Option&lt;TResult&gt; With&lt;T, TResult&gt;(this Option&lt;T&gt; option, Func&lt;T, TResult&gt; selectFunc, Func&lt;TResult&gt; defaultFunc)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><a class="xref" href="CodeJam.Option-1.html">Option</a>&lt;T&gt;</td>
        <td><span class="parametername">option</span></td>
        <td><p><a class="xref" href="CodeJam.Option.html">Option</a> instance to match.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Func</span>&lt;T, TResult&gt;</td>
        <td><span class="parametername">selectFunc</span></td>
        <td><p>Function to map value</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.Func</span>&lt;TResult&gt;</td>
        <td><span class="parametername">defaultFunc</span></td>
        <td><p>Function to return default value.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><a class="xref" href="CodeJam.Option-1.html">Option</a>&lt;TResult&gt;</td>
        <td><p>Converted by <code data-dev-comment-type="paramref" class="paramref">selectFunc</code> value, or option with value returned by
<code data-dev-comment-type="paramref" class="paramref">defaultFunc</code>, if <code data-dev-comment-type="paramref" class="paramref">option</code> has no value.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="typeParameters">Type Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="parametername">T</span></td>
        <td><p>Type of value</p>
</td>
      </tr>
      <tr>
        <td><span class="parametername">TResult</span></td>
        <td><p>Type of result</p>
</td>
      </tr>
    </tbody>
  </table>
</article>
          </div>
          
          <div class="hidden-sm col-md-2" role="complementary">
            <div class="sideaffix">
              <div class="contribution">
                <ul class="nav">
                  <li>
                    <a href="https://github.com/rsdn/CodeJam/new/master/apiSpec/new?filename=CodeJam_Option.md&amp;value=---%0Auid%3A%20CodeJam.Option%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Improve this Doc</a>
                  </li>
                  <li>
                    <a href="https://github.com/rsdn/CodeJam/blob/master/Main/src/Structures/Option/Option.cs/#L10" class="contribution-link">View Source</a>
                  </li>
                </ul>
              </div>
              <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
              <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
              </nav>
            </div>
          </div>
        </div>
      </div>
      
      <footer>
        <div class="grad-bottom"></div>
        <div class="footer">
          <div class="container">
            <span class="pull-right">
              <a href="#top">Back to top</a>
            </span>
            Copyright � 2015-2017
            
          </div>
        </div>
      </footer>
    </div>
    
    <script type="text/javascript" src="../../styles/docfx.vendor.js"></script>
    <script type="text/javascript" src="../../styles/docfx.js"></script>
    <script type="text/javascript" src="../../styles/main.js"></script>
  </body>
</html>
